package videoCourse.Structure;

import javax.swing.tree.TreeNode;

public class BinaryTree {

    private  BinaryNode root;

    public void setRoot(BinaryNode root) {
        this.root = root;
    }

    public BinaryNode getRoot() {
        return root;
    }

    public void frontShow() {
        if(root == null){
            System.out.println("null");
        }else{
            root.frontShow();
        }
    }

    public void midShow() {

        root.midShow();

    }

    public void endShow() {

        root.endShow();

    }

    public BinaryNode frontSearch(int i) {
        return root.frontSerch(i);
    }

    public void deleteTree(int i) {
        if(root.value==i){
            root = null;
        }else{
            root.deleteTree(i);
        }
    }
}
